package com.wangshouyu.mp.pay.unified;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Objects;

/**
 * @author 王守钰
 * @description jsapi统一下单请求
 * @date 2020/8/13 10:53
 */
@XStreamAlias(value = "xml")
public class JsApiUnifiedRequest extends BaseUnifiedRequest {

    /**
     * 商品ID
     */
    @XStreamAlias(value = "product_id")
    private String productId;

    /**
     * 场景信息
     */
    @XStreamAlias(value = "scene_info")
    private String sceneInfo;

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getSceneInfo() {
        return sceneInfo;
    }

    public void setSceneInfo(String sceneInfo) {
        this.sceneInfo = sceneInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        JsApiUnifiedRequest that = (JsApiUnifiedRequest) o;
        return Objects.equals(productId, that.productId) &&
                Objects.equals(sceneInfo, that.sceneInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), productId, sceneInfo);
    }

    @Override
    public String toString() {
        return "JsApiUnifiedRequest{" +
                "productId='" + productId + '\'' +
                ", sceneInfo='" + sceneInfo + '\'' +
                '}';
    }
}
